home *** CD-ROM | disk | FTP | other *** search
- #include <exec/exec.h>
- #include <intuition/intuition.h>
- #include <intuition/screens.h>
- #include <graphics/displayinfo.h>
- #include <libraries/asl.h>
- #include <workbench/startup.h>
-
- #include <clib/asl_protos.h>
- #include <clib/exec_protos.h>
- #include <clib/intuition_protos.h>
- #include <stdio.h>
-
- #include "XIM:glue.h"
- #include "XIM:doorheader.h"
- struct Library *AslBase = NULL;
- struct Library *IntuitionBase = NULL;
- struct Screen *screen=NULL;
- struct Window *window=NULL;
-
- void LastCommand(void);
- void end(void);
- char temp[200];
-
- #define gu getuserstring
- #define sm sendmessage
- void main(int argc,char **argv)
- {
- struct FileRequester *fr;
- struct WBArg *frargs;
- int x;
- Register(argv[1][0]-'0');
- gu(temp,RAWSCREEN_ADDRESS);
- screen=(struct Screen *)atol(temp);
- AslBase=OpenLibrary("asl.library",0L);
- IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0L);
- window=(struct Window *)screen->FirstWindow;
- fr=(struct FileRequestor *)AllocAslRequestTags(ASL_FileRequest,
- ASL_Hail,(ULONG)"FilePat/MultiSelect Demo",
- ASL_Dir,(ULONG)"libs:",
- ASL_File,(ULONG)"asl.library",
- ASL_Pattern,(ULONG)"#?",
- ASL_FuncFlags, FILF_MULTISELECT|FILF_PATGAD,
- ASL_Window, window,
- TAG_DONE);
-
- if(AslRequest(fr,0L))
- {
- if(fr->rf_NumArgs)
- {
- frargs=fr->rf_ArgList;
-
- for(x=0;x<fr->rf_NumArgs;x++){
- sprintf(temp,"Argument %d: PATH=%s FILE=%s",
- x,fr->rf_Dir,frargs[x].wa_Name);sm(temp,1); }
- }
- else {
- sprintf(temp,"PATH=%s FILE=%s",fr->rf_Dir,fr->rf_File);
- sm(temp,1); }
- }
- FreeAslRequest(fr);
- CloseLibrary(IntuitionBase);
- CloseLibrary(AslBase);
- ShutDown();
- end();
- }
-
- void LastCommand(void)
- {
- sm("",1);
- sm("",1);
- }
-
- void end(void)
- {
- exit(0);
- }